package com.etone.export.DB2DB.dao;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Formatter;

public class SybaseDao extends BaseDao{

	private static String DIRVER = "com.sybase.jdbc3.jdbc.SybDriver";
	private String url="jdbc:sybase:Tds:%s:%s/%s";
	
	private String user;
	private String pwd;
	

	public SybaseDao(String ip, int port, String database, String user, String pwd) {
		
		url =  new Formatter().format(url, ip,port,database).toString();
		
		System.out.println(url);
		
		this.pwd = pwd;
		this.user = user;
	}
	
	@Override
	public Connection getConn() {
		
		try {
			return initConn(DIRVER, url, user, pwd);
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		return null;
	}

}
